<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
    
     <div class="container-div">
		<div class="row">
			<div class="col-sm-12 search-collapse">
				<form id="formId">
					<div class="select-list">
						<ul>
							<li>
								订单编号：<input type="text" name="orderNo"/>
							</li>
							
							<li>
								商户编号：<input type="text" name="merchantNo"/>
							</li>
							<li>
								身份证号：<input type="text" name="acqId"/>
							</li>
							
							<li>
								交易类型：<select name="tradeType">
									<option value="">所有</option>
									<option value="ZX">征信查询</option>
									<option value="CP">卡测评</option>
								</select>
							</li>
							<li>
								交易状态：<select name="sTATUS" th:with="type=${@dict.getType('trade_status')}">
									<option value="">所有</option>
									<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
								</select>
							</li>
							<li class="select-time">
								<label>完成时间： </label>
								<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginTime]"/>
								<span>-</span>
								<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endTime]"/>
							</li>
							<li>
								<a id="btnSearch" class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
								<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
							</li>
						</ul>
					</div>
				</form>
			</div>
			
	       	<div class="btn-group-sm hidden-xs" id="toolbar" role="group">
				<!-- <a class="btn btn-warning" onclick="$.table.exportExcel()">
						<i class="fa fa-download"></i> 导出
				 </a> -->
				 <a class="btn btn-warning" onclick="$.operate.removeAll()" shiro:hasPermission="system:hatchetOrderPayment:remove">
				分润下发
				</a>
				  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				<font><b>订单总金额：</b><span id="spanSumMoney" > </span>元</font>
			</div>
			<div class="col-sm-12 select-table table-striped">
				<table id="bootstrap-table" data-mobile-responsive="true"></table>
			</div>
		</div>
	</div>
    <div th:include="include :: footer"></div>
    <script th:inline="javascript">
    	var removeFlag = [[${@permission.hasPermi('system:hatchetOrderPayment:remove')}]];
        var settleStatus = [[${@dict.getType('settleList_status')}]];
        var tradeType = [[${@dict.getType('trade_type')}]];
        var tradeStatus = [[${@dict.getType('trade_status')}]];
        var prefix = ctx + "system/hatchetOrderPayment";

        $(function() {
        	//点击总金额清零
        	$("#btnSearch").click(function(){
        		$("#spanSumMoney").text(0);
        	});
        	
            var options = {
                url: prefix + "/zhengxinList",
				exportUrl: prefix + "/export",
				removeUrl: prefix + "/remove",
                modalName: "订单",
				search: false,
		        showExport: false,
                columns: [{
		            checkbox: true
		        },
		        {
					field : 'id', 
					title : '主键id',
					visible: false
				},
				{
					field : 'sumMoney', 
					title : '总金额',
					visible: false
				},
				{
					field : 'orderNo', 
					title : '订单号',
					sortable: true
				},
				{
					field : 'completeTime', 
					title : '完成时间',
					sortable: true
				},
				{
					field : 'merchantName', 
					title : '商户名称',
					sortable: false
				},
				{
					field : 'merchantNo', 
					title : '商户编号',
					sortable: false
				},
				{
					field : 'acqTerminalId', 
					title : '认证卡号',
					sortable: false
				},
				{
					field : 'acqId', 
					title : '认证身份证号',
					sortable: false
				},
				{
					field : 'acqMerchantId', 
					title : '认证手机号',
					sortable: false
				},
				{
					field : 'tradeType', 
					title : '交易类型',
					align : 'left',
					formatter: function(value, item, index) {
	            		return $.table.selectDictLabel(tradeType, item.tradeType);
	            	} 
				},
				{
					field : 'settleListStatus', 
					title : '清分状态',
					align : 'left',
					formatter: function(value, item, index) {
	            		return $.table.selectDictLabel(settleStatus, item.settleListStatus);
	            	} 
				},
				{
					field : 'trxAmt', 
					title : '交易金额(元)',
					sortable: true
				},
				{
					field : 'status', 
					title : '交易状态',
					align : 'left',
					formatter: function(value, item, index) {
						if(item.sumMoney != null){
	            			$("#spanSumMoney").text(item.sumMoney);
	            		} 
	            		return $.table.selectDictLabel(tradeStatus, item.status);
	            	} 
				}]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>